#include <stdio.h>

int NumberOf1(int n);

int main() {
	int num = 0;
	scanf("%d", &num);
	printf("%d", NumberOf1(num));
	return 0;
}

int NumberOf1(int n) {
	int count = 0;
	while (n) {
		n = n & (n - 1);
		count++;
	}
	return count;
}